<include file="Public/header"/>
<div class="row">
    <div class="col-md-12">
        <div class="ibox float-e-margins">
            <div class="ibox-content">
                <form class="layui-form" action="" autocomplete="off" id="editwtstatus">
                    <input type="hidden" name="id" value="<{$info.id}>">
                    <input type="hidden" name="userid" value="<{$info.userid}>">
                    <input type="hidden" name="tkmoney" value="<{$info.tkmoney}>">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <select name="status">
                                    <option value="">选择操作</option>
                                    <option <if condition="$info['status'] eq 1">selected</if> value="1">变更为处理中</option>
                                    <option <if condition="$info['status'] eq 2">selected</if> value="2">变更为已处理</option>
                                    <option <if condition="$info['status'] eq 3">selected</if> value="3">驳回结算</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <button class="layui-btn" lay-submit="" lay-filter="wtsave">立即提交</button>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <textarea placeholder="驳回理由" class="layui-textarea" name="memo"></textarea>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<include file="Public/footer"/>
<script>
    layui.use(['laydate', 'laypage', 'layer', 'table', 'form'], function () {
        var laydate = layui.laydate //日期
            , laypage = layui.laypage //分页
            , layer = layui.layer //弹层
            , form = layui.form //表单
            , table = layui.table; //表格

        //监听提交
        form.on('submit(wtsave)', function (data) {
            $.ajax({
                url: "<{:U('Admin/Withdrawal/editwtStatus')}>",
                type: "post",
                data: $('#editwtstatus').serialize(),
                success: function (res) {
                    if (res.status) {
                        layer.alert("编辑成功", {icon: 6}, function () {
                            parent.location.reload();
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        });
                    } else {
                        layer.msg(res.msg ? res.msg : "操作失败!", {icon: 5}, function () {
                            parent.location.reload();
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        });
                        return false;
                    }
                }
            });
            return false;
        });
    });
</script>
</body>
</html>